<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:pt="http://xmlns.jcp.org/jsf/passthrough">
    <h:head>

        <h:outputStylesheet library="css" name="product.css"  />
    </h:head>
    <h:body>

        <ui:composition template="/templates/homeTemplate.xhtml">

            <ui:define id="prod" name="content">
               
                <h:form id="prodform" styleClass="empty">
                    <div class="container">
                        
                        <div class="row">
                            <div class="col-lg-2">
                                <h:button value="Back" outcome="AUserP" style="width:100px;height: 40px;line-height: 13px;" styleClass="Pbutton">
                                    <span style="position: absolute;left:23px;top: 13px;pointer-events: none;" class="glyphicon glyphicon-arrow-left"></span>
                                </h:button>
                            </div>
                            <div class="col-lg-10">
                                
                            </div>
                        </div>
                        <hr/>
                        <div class="col-lg-3" ></div>
                        <div class="col-lg-6" >
                            <div class="row panel panel-default #{admin.userView.admin ? 'adminUser' : ''}" >
                           
                                <div class="col-lg-2" ></div>
                                <div class="col-lg-6" >
                                    <div class="row">
                                        <div class="col-xs-12">
                                            <h3 class="">#{admin.userView.FName} #{admin.userView.LName}</h3>
                                            <h4>#{admin.userView.username}   </h4>
                                            <p>#{admin.userView.address.email} </p>
                                        </div>


                                    </div>
                                    <hr/>
                                    <div class="row">
                                        <div class="col-xs-6">
                                            <p>#{admin.userView.address.addrline1} </p>
                                            <p>#{admin.userView.address.addrline2} </p>
                                            <p>#{admin.userView.address.city} </p>
                                            <p>#{admin.userView.address.county} </p>
                                            <p>#{admin.userView.address.zipCode} </p>
                                        </div>
                                        <div class="col-xs-2"></div>
                                        <h:panelGroup id="buttonendis">
                                            <h:panelGroup  layout="block" styleClass="col-xs-1" rendered="#{!admin.userView.admin}">
                                                <h:commandButton  styleClass="Hbutton" value=" " style="width:30px;color:black;" action="#{admin.PromoteUser(admin.userView, true)}">
                                                    <span style="position: absolute;left:13px;top:8px;pointer-events: none;" class="glyphicon glyphicon-plus"></span>
                                                    <f:ajax execute="@this" render="buttonendis prodform prod"/>
                                                </h:commandButton> 
                                            </h:panelGroup>
                                            <h:panelGroup  layout="block" styleClass="col-xs-1" rendered="#{admin.userView.admin}">
                                                <h:commandButton  styleClass="Hbutton" value=" " style="width:30px;color:black;" action="#{admin.DemoteUser(admin.userView, true)}">
                                                    <span style="position: absolute;left:13px;top:8px;pointer-events: none;" class="glyphicon glyphicon-minus"></span>
                                                    <f:ajax execute="@this" render="buttonendis prodform prod"/>
                                                </h:commandButton> 
                                            </h:panelGroup>
                                            <div class="col-xs-1"></div>
                                            <h:panelGroup  layout="block" styleClass="col-xs-1">
                                                <h:commandButton  styleClass="Hbutton" value=" "  onclick="if (! confirm('Are you sure you want to delete this user?\nIt will delete their address, order history and shopping cart')) return false" style="width:30px;color:black;" action="#{admin.RemoveUserFromView(admin.userView)}">
                                                    <span style="position: absolute;left:13px;top:8px;pointer-events: none;color:black;" class="glyphicon glyphicon-remove"></span>
                                                    <f:ajax execute="@this" render="buttonendis prodform prod"/>
                                                </h:commandButton> 
                                            </h:panelGroup> 
                                        </h:panelGroup>

                                    </div>
                                </div>
                            
                            </div>
                            
                        </div>
                        <div class="col-lg-3" ></div>
                        
                        

                    </div>



                </h:form>

                <br></br>                                               

            </ui:define>
        </ui:composition>

        

    </h:body >
</html>
